package com.seventh.restaurant.repository;

import com.seventh.restaurant.domain.BookingRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@SuppressWarnings("unused")
@Repository
public interface BookingRecordRepository extends JpaRepository<BookingRecord,Long> {

    @Query("SELECT a FROM BookingRecord a WHERE a.id=?1 ")
    BookingRecord getOneBooking(Long id);

    List<BookingRecord> findByCustomerPhoneNumberOrderByBookingTimeDesc(String phonenumber);

    @Query("SELECT a FROM BookingRecord a WHERE a.recordCancle=?1 and a.isOver <> '1' ")
    List<BookingRecord> findByRecordCancle(String iscancel);

    List<BookingRecord> findByIsOver(String kind);


}
